#include <iostream>
#include <cstring>
#include <stdlib.h>
using namespace std;
int main(int argc, char* argv[])
{
    //if(argc != 2)
    //{
    //    printf("Usage:%s filename", argv[0]);
    //    return 1;
    //}
    FILE* pf = fopen("test.txt", "r");
    if(pf == nullptr)
    {
        perror("fopen");
        return 2;
    }

    while(1)
    {
        char buffer[256];
        int n = fread(buffer, strlen(buffer) - 1, 1, pf);
        if(n > 0)
        {
            buffer[0] = 1;
            printf("%s", buffer);
        }
        if(n == 0) 
        {
            break;
        }
    }
    cout << endl;
    fclose(pf);
    return 0;
}
